<%--
  Created by IntelliJ IDEA.
  User: 祝亚
  Date: 2016/8/17
  Time: 13:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title></title>
</head>
<body>
<div class="pageHeader">
  <form rel="pageForm" onsubmit="return navTabSearch(this);"
        action="<c:url value='/exam/question/index'/>" method="post">
    <div class="searchBar">
      <ul>
        <li style="float: left; line-height: 25px;">
          <label>名称：</label> <input name="keywords"
                                     type="text" value="${query.keywords}"
                                     placeholder="请输入题目名称检索"
                                     style="width: 230px; font-family: '微软雅黑 sans-serif serif';"/></li>
        <li>
          <div class="buttonActive" style="margin-left: 5px;">
            <div class="buttonContent">
              <button type="submit">查找</button>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </form>
</div>
<div class="pageContent" style="padding-top: 1px;">
    <div class="panelBar">
        <ul class="toolBar" style="float: left;display: inline-block;">
            <li><a class="add" href="<c:url value='/exam/question/view/-1'/>" target="dialog" width="620" height="440" mask="true"
                   resizable="false" maxable="false"><span>添加题目</span></a></li>
            <li class="line"></li>
            <li><a class="delete" href="<c:url value='/exam/test/delete/{sel_id}'/>" target="ajaxDel" title="是否确认删除当前题目？"><span>删除</span></a></li>
            <li class="line"></li>
            <%--<li><a class="add" href="<c:url value='/exam/question/view/{sel_id}'/>" target="dialog" width="520" height="240" mask="true" resizable="false"
                   maxable="false" title="查看题目" ><span>查看</span></a></li>--%>
        </ul>
    </div>
  <table class="table" width="100%" layoutH="110">
    <thead>
    <tr>
      <th width="20" align="center">序号</th>
      <th width="150">题目名称</th>
      <th width="80">题目类型</th>
      <th width="80">分值</th>
      <th width="150">答案</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="question" items="${pager.list}" varStatus="vs">
      <tr target="sel_id" rel="${question.id}">
          <td>${vs.count+(pager.pageNum-1)*pager.numPerPage}</td>
          <td>${question.title}</td>
        <c:if test="${question.type eq '1'}"><td>单选题</td></c:if>
        <c:if test="${question.type eq '2'}"><td>多选题</td></c:if>
        <c:if test="${question.type eq '3'}"><td>判断题</td></c:if>
          <td>${question.goals}</td>
          <td>${question.answer}</td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  <div class="panelBar">
    <div class="pages">
      <span>显示&nbsp;</span> <select id="cob_ps" class="combox"
                                    name="numPerPage"
                                    onchange="navTabPageBreak({numPerPage:this.value})">
      <option value="20" <c:if test="${pager.numPerPage == 20}"> selected="selected"</c:if>>20</option>
      <option value="50" <c:if test="${pager.numPerPage == 50}"> selected="selected"</c:if>>50</option>
      <option value="100" <c:if test="${pager.numPerPage == 100}"> selected="selected"</c:if>>100</option>
      <option value="200" <c:if test="${pager.numPerPage == 200}"> selected="selected"</c:if>>200</option>
    </select> <span>条，共${pager.total}条</span>
    </div>
    <div class="pagination" targetType="navTab"
         totalCount="${pager.total}" numPerPage="${pager.numPerPage}"
         pageNumShown="10" currentPage="${pager.pageNum}"></div>
  </div>
  <form id="pagerForm" method="post"
        action="<c:url value='/exam/question/index'/>">
    <input type="hidden" name="pageNum" value="${pager.pageNum}"/>
    <input type="hidden" name="handler" value="${query.handler}"/>
    <input type="hidden" name="numPerPage" value="${pager.numPerPage}"/>
    <input type="hidden" name="orderField" value="${query.orderField}"/>
    <input type="hidden" name="orderDirection"
           value="${query.orderDirection}"/>
      <input type="hidden" name="keywords"
             value="${query.keywords}"/>
  </form>
</div>

</body>
</html>
